package com.tanhua.dubbo.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.domain.db.Log;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

public interface LogMapper extends BaseMapper<Log> {
    @Select("select count( DISTINCT user_id ) as num  from tb_log where log_time=#{todayStr} and type=#{type}")
    Integer queryRegisterOrLoginNum(@Param("todayStr") String todayStr, @Param("type") String type);

    @Select(" select count( DISTINCT user_id ) as num  from tb_log where log_time=#{todayStr}")
    Integer queryActiveNum(String todayStr);

    @Select("select count( DISTINCT user_id  ) as num  from tb_log where log_time=#{todayStr} " +
            "    and user_id in  (  select   user_id   from tb_log where log_time=#{yesTodayStr} and type='0102')")
    Integer queryRetention1dNum(@Param("todayStr") String todayStr, @Param("yesTodayStr") String yesTodayStr);
}
